@pendingColor: #2196f3;
@failColor: #f44336;
@suspendColor: #ffa340;
@completedColor: #01ca83;
@pendingBgColor: #e7f3fd;
@failBgColor: #fdebe9;
@suspendBgColor: #fff5eb;
@completedBgColor: #e5f9f1;

.workflowHistoryWrap {
  margin-top: 20px;
  .nano-content {
    padding: 0 20px;
  }
  .lastPublishInfo {
    max-width: 1400px;
    display: flex;
    margin: 10px auto 20px;
    color: #757575;
    font-size: 14px;
    .restoreWrap {
      margin-left: 15px;
      border-bottom: 1px dashed #757575;
      cursor: pointer;
    }
  }
  .workflowHistoryContentWrap {
    max-width: 1400px;
    margin: 0 auto 20px;
    box-sizing: border-box;
    background-color: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16);
    min-height: 200px;
    .historyHeader {
      display: flex;
      align-items: center;
      padding: 24px;
      .historyHeaderStatusDropdown {
        display: flex;
        height: 36px;
        box-sizing: border-box;
        border: 1px solid #ddd;
        border-radius: 3px;
        padding: 0 5px;
        min-width: 112px;
        margin-left: 10px;
        margin-right: 10px;
        .arrow {
          margin-left: 15px;
        }
      }
      .filterTimeRange {
        width: 280px;
        height: 36px;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-width: 170px;
        padding: 5px 10px;
        border: 1px solid #ddd;
        border-radius: 3px;
        .placeholder {
          color: #bdbdbd;
        }
      }
      .historyHeaderBtn {
        padding: 0 16px;
        font-weight: bold;
        border-radius: 4px;
        height: 36px;
        background-color: #2196f3;
        color: #fff;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        &.stop {
          background-color: #ffa340;
        }
        &.refresh {
          background-color: #01ca83;
        }
        &.disabled {
          cursor: not-allowed;
          opacity: 0.6;
        }
      }
    }
    .historyList {
      padding: 0 24px;
      &.littleData {
        li:last-child {
          border-bottom: none;
        }
      }
      .triggerData,
      .cause {
        margin-right: 24px;
      }
      .noMoreDataText {
        padding: 15px 0;
        text-align: center;
      }
    }
    .clearFilter {
      margin-left: 24px;
      cursor: pointer;
    }
    .emptyListWrap {
      padding: 100px 0;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      .imgWrap {
        width: 130px;
        height: 130px;
        border-radius: 50%;
        background: url('./emptyList.png') no-repeat center center;
        background-size: cover;
      }
      .text {
        margin-top: 24px;
      }
    }
    .moreDataWrap {
      padding: 20px 0;
    }
    .moreData {
      box-sizing: border-box;
      width: 98px;
      line-height: 38px;
      margin: 0 auto;
      color: #2196f3;
      background-color: #fff;
      border: 1px solid #2196f3;
      border-radius: 3px;
      text-align: center;
      cursor: pointer;
      &:hover {
        background-color: #2196f3;
        color: #fff;
      }
    }
    ul.historyListTitle {
      display: flex;
      padding: 8px 24px;
      border-bottom: 1px solid #ddd;
      height: 40px;
      .status,
      .time {
        min-width: 160px;
      }
      .retry,
      .version {
        min-width: 30px;
      }
      .triggerData,
      .cause {
        margin-right: 24px;
      }
      .batch {
        min-width: 40px;
      }
    }
    li.historyListItem {
      display: flex;
      align-items: center;
      border-bottom: 1px solid #ddd;
      padding: 15px 0;
      cursor: pointer;
      position: relative;
      &:hover {
        .retry,
        .version {
          visibility: visible;
        }
      }
      .status,
      .triggerTime {
        min-width: 160px;
      }
      .retry,
      .version {
        height: 16px;
        min-width: 30px;
        visibility: hidden;
      }
      .batch {
        min-width: 40px;
      }
    }

    .historyStatus {
      display: flex;
      align-items: center;
      .statusText {
        font-weight: 600;
      }
      .historyStatusIcon {
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        margin-right: 10px;
        .icon {
          color: #fff;
        }

        .statusIcon-pending {
          margin-left: 10px;
          width: 0;
          height: 0;
          border: 1px solid transparent;
          border-width: 8px 10px;
          border-left-color: #fff;
        }
        .statusIcon-completed {
          width: 4px;
          height: 12px;
          border: 2px solid #fff;
          border-top-color: transparent;
          border-left-color: transparent;
        }
        &.pending {
          background-color: @pendingColor;
        }
        &.fail {
          background-color: @failColor;
        }
        &.suspend,
        &.overrule,
        &.filter {
          background-color: @suspendColor;
          .icon {
            margin-right: 4px;
          }
        }
        &.completed {
          background-color: @completedColor;
        }
      }
    }
    .historyDetailWrap {
      .header {
        padding: 0 24px;
        line-height: 60px;
        border-bottom: 1px solid #ddd;
        cursor: pointer;
        .backText {
          margin-left: 10px;
        }
      }
      .detailContent {
        padding: 24px;
        .itemInfo {
          display: flex;
          align-items: center;
          padding: 10px 24px;
          min-height: 90px;
          border-radius: 6px;
          position: relative;
          .title {
            margin-left: 40px;
            font-weight: 550;
            min-width: 0;
          }
        }
        .logWrap {
          .logTitle {
            padding: 12px 0;
            border-bottom: 1px solid #ddd;
            font-weight: 550;
          }
          .logList {
            li {
              display: flex;
              align-items: center;
              padding: 20px 0;
              border-bottom: 1px solid #ddd;
              position: relative;
              &:last-child {
                border: none;
              }
              .placeholder {
                width: 160px;
              }
              .operationTime {
                min-width: 160px;
                .leaveTime {
                  margin-top: 12px;
                }
              }
              .flowItemHistory {
                min-width: 220px;
                align-items: center;
              }
              .operationPerson {
                flex: 3;
                margin-right: 15px;
                min-width: 0;
                .info {
                  margin-top: 12px;
                  word-break: break-all;
                }
                .personDetail {
                  align-items: center;
                }
                .personInfo {
                  white-space: normal;
                  word-break: break-all;
                  flex-wrap: wrap;
                  span {
                    max-width: 200px;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    display: inline-block;
                  }
                }
              }
              .overrule,
              .filter {
                color: @suspendColor;
              }
              .fail {
                color: @failColor;
              }

              .originNode {
                display: flex;
                align-items: center;
                flex: 2;
                min-width: 0;
                margin-right: 15px;
                .nodeName {
                  margin-left: 12px;
                }
              }
            }
          }
        }
        .historyDetailRetry {
          float: right;
          margin-top: 5px;
        }
      }
      .historyDetailRetry {
        height: 24px;
        display: inline-flex;
        align-items: center;
        padding: 0px 6px 0 4px;
        border-radius: 4px;
        border: 1px solid #2196f3;
        background-color: #fff;
        cursor: pointer;
        font-size: 12px;
        color: #2196f3;
        &.historyDetailRetryDisabled {
          color: #bdbdbd;
          background-color: #f5f5f5;
          border-color: #ddd;
        }
      }
      .historyDetailRetryResult {
        height: 24px;
        display: inline-flex;
        align-items: center;
        padding: 0px 6px 0 6px;
        border-radius: 4px;
        border: 1px solid rgba(33, 150, 243, 0.2);
        background-color: rgba(33, 150, 243, 0.1);
        font-size: 12px;
        color: #2196f3;
      }
    }
  }
  .workflowNodeIconWrap {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    min-width: 22px;
  }
  .instanceContent {
    padding: 22px 24px 0;
    margin-bottom: -10px;
    .instanceContentBox {
      background: #f5f5f5;
      border-radius: 3px;
      padding: 0 12px;
      align-items: center;
      height: 44px;
    }
  }
  .historyRefresh {
    animation: rotate 1s linear infinite;
  }
}

.historyBox {
  width: 480px;
  background: #fff;
  border-radius: 3px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  padding: 12px 0;
  min-height: 140px;
  max-height: 500px;
  position: absolute;
  z-index: 1;
  margin-top: 5px;
  right: 0;
  .historyReleaseItem {
    height: 40px;
    align-items: center;
    padding: 0 29px 0 12px;
    margin: 0 12px;
    color: #333;
    &:hover {
      .icon-restore2 {
        visibility: visible;
      }
    }
    &:not(.noBG):hover {
      background: #f2f2f2;
      .w250 {
        color: #2196f3;
      }
    }
    .icon-restore2 {
      visibility: hidden;
    }
    .w250 {
      width: 250px;
    }
    .flexRow {
      align-items: center;
    }
    .historyReleaseItemActive {
      font-size: 12px;
      color: #2196f3;
      padding: 4px 8px;
      margin-left: 10px;
      border-radius: 9px;
      background: rgba(33, 150, 243, 0.12);
    }
  }
}

.workflowRetryLoading {
  height: 3px;
  width: 10px;
  position: absolute;
  left: 0;
  top: 0;
  background: #2196f3;
  animation: retryFadeMove 0.6s linear infinite forwards;
}

@keyframes retryFadeMove {
  from {
    width: 10px;
    left: 0;
  }

  50% {
    width: 500px;
    left: 20%;
  }

  to {
    width: 0;
    left: 100%;
  }
}

.workflowHistoryBox {
  .filterTimeRange {
    width: 100%;
    height: 36px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    .placeholder {
      color: #bdbdbd;
    }
  }
}
